package com.jtpay.sdk.util;

import android.app.Activity;

import com.jtpay.sdk.activity.LoginActivity;
import com.jtpay.sdk.activity.OrderActivity;

import appUtils.AppUtil;

/**
 * Created by Administrator on 2017/8/25.
 */

public class AuthUtil {
    private AuthUtil() {
    }

    public static AuthUtil getInstance() {
        return Holder.instance;
    }

    public void logOut() {
        for (Activity activity : AppUtil.getInstance().getActivityList()) {
            if (!activity.getClass().equals(LoginActivity.class)) {
                activity.finish();
            }
        }
    }

    public void resetTest() {
        for (Activity activity : AppUtil.getInstance().getActivityList()) {
            if (!activity.getClass().equals(LoginActivity.class) && !activity.getClass().equals(OrderActivity.class)) {
                activity.finish();
            }
        }
    }

    private static final class Holder {
        private static final AuthUtil instance = new AuthUtil();
    }
}
